import http from '@/utils/request'
export default {
  queryWithPage: {
    url: `api/role/query-with-page`,
    name: '角色管理表-分页查询',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
  save: {
    url: `api/role/save`,
    name: '角色管理表-新增',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
  modify: {
    url: `api/role/modify`,
    name: '角色管理表-修改',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
  delete: {
    url: `api/role/delete/`,
    name: '角色管理表-删除',
    get: async function (data) {
      return await http.get(this.url + data)
    }
  },
  deleteBatch: {
    url: `api/role/delete-batch`,
    name: '角色管理表-批量删除',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
  changeInvalid: {
    url: `api/role/change-status/`,
    name: '角色管理表-更改状态',
    get: async function (data) {
      return await http.get(this.url + data)
    }
  },
  queryById: {
    url: `api/role/`,
    name: '角色管理表-查询',
    get: async function (data) {
      return await http.get(this.url + data)
    }
  },
  queryTreeByUserId: {
    url: `api/role/query-tree-by-user-id/`,
    name: '角色管理表-通过userId查询树',
    get: async function (data) {
      return await http.get(this.url + data)
    }
  },
  queryByUserId: {
    url: `api/role/query-by-user-id/`,
    name: '角色管理表-通过userId查询树',
    get: async function (data) {
      return await http.get(this.url + data)
    }
  },
  getRoleInfo: {
    url: `api/role/get-role-info/`,
    name: '角色管理表-通过userId查询角色信息',
    get: async function (data) {
      return await http.get(this.url + data)
    }
  },
  queryAll: {
    url: `api/role/query-all`,
    name: '角色管理表-查询所有角色',
    get: async function () {
      return await http.get(this.url)
    }
  },
  queryAllWithRight: {
    url: `api/role/query-all-with-right`,
    name: '角色管理表-鉴权查询角色',
    get: async function () {
      return await http.get(this.url)
    }
  },
  roleMenuBind: {
    url: `api/roleMenu/role-menu-bind`,
    name: '角色菜单管理表-绑定',
    post: async function (data) {
      return await http.post(this.url, data)
    }
  },
  getRoleParentIds: {
    url: `api/role/get-role-parent-ids/`,
    name: '角色管理表-查询父级角色ids',
    get: async function (data) {
      return await http.get(this.url + data)
    }
  }
}